/*
 * Copyright (c) 2018. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

package com.gov.dna.base.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 扩展Model 加入基本字段
 * @author (作者) Dong Jie 154046519@qq.com
 * @version V1.0
 * @date 2018/12/6 10:29
 * @since (该版本支持的JDK版本) 1.8
 */
@Data
public  class BaseModel<T extends BaseModel> extends Model<T>{

	@TableId
	@ApiModelProperty(value="id")
	private Long id;

	/**
	 * 发布时间
	 */
	@ApiModelProperty(value="发布时间")
	@TableField(value = "create_time",fill = FieldFill.INSERT)
	private LocalDateTime createTime;

	/**
	 * 修改时间
	 */
	@ApiModelProperty(value="修改时间")
	private LocalDateTime modifiedTime;

	/**
	 * 逻辑删除标志 0：正常 1：已删除 数据库字段类型tinyint(1)
	 */
	@ApiModelProperty(value="逻辑删除标志 0：正常 1：已删除 数据库字段类型tinyint(1)")
	@TableField(value="is_deleted")
	private Boolean deleted=false;

	@Override
	protected Serializable pkVal() {
		return id;
	}

}
